
from django.conf.urls import url, include
from django.contrib import admin
from . import views
urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view()),  # 注册页面的路由
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UsernameCountView.as_view()), # 用户名是否重复的路由
    url(r'^mobiles/(?P<mobile>1[345789]\d{9})/count/$', views.MobileCountView.as_view()), # 手机是否重复的路由
    url(r'^login/$', views.LoginView.as_view()),  # 登陆路由
    url(r'^logout/$', views.LogoutView.as_view()),  # 退出路由
    url(r'^info/$', views.InfoView.as_view()),  # 用户中心
    url(r'^emails/$', views.EmaileView.as_view()),  # 发送邮箱
    url(r'^emails/verification/$', views.VerifyEmailView.as_view()),    # 接受邮箱发回来
    url(r'^addresses/$', views.AddressView.as_view()),  # 收货地址
    url(r'^addresses/create/$', views.CreateAddressView.as_view()),     # 新增收货地址
    url(r'^addresses/(?P<address_id>\d+)/$', views.UpdateDetroyAddressView.as_view()),  # 修改和删除的路由
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view()),   # 修改默认路由
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.UpdateTitleAddressView.as_view()),     # 修改默认地址
    url(r'^password/$', views.ChangepasswordView.as_view()),    # 修改密码
    url(r'^browse_histories/$', views.HistoryGoodsView.as_view()),
    url(r'^find_password/$', views.ForgetbeginView.as_view()),  # 找回密码的页面
    url(r'^accounts/(?P<username_or_mobile>1[3456789]\d{9}|[a-zA-Z0-9_-]{5,20})/sms/token/$', views.ForgetoneView.as_view()),   # 找回密码第一步
    url(r'^sms_codes/$', views.ForgetTwoView.as_view()),   # 找回密码第二步
    url(r'^accounts/(?P<username_or_mobile>1[3456789]\d{9}|[a-zA-Z0-9_-]{5,20})/password/token/$', views.ForgetThreeView.as_view()),   # 找回密码第二步
    url(r'^users/(?P<user_id>\d+)/password/$', views.ForgetFourView.as_view()),   # 找回密码第二步

]
